<?php

namespace app\api\controller\ai;

use thinkct\controller\Frontend;

class H5  extends Frontend
{
    protected array $noNeedLogin = ['*'];

    public function initialize(): void
    {
        parent::initialize();
    }

    public function index(): void
    {
        $notice = get_sys_config('notice', 'h5');
        $slideImages = get_sys_config('slide_images', 'h5');
        // \storage\default\20240925\userb1c0a99d22a4a41f57a3fa567c64684fc669c26b.jpg,\storage\default\20240925\userb1c0a99d22a4a41f57a3fa567c64684fc669c26b.jpg,\storage\default\20240925\userb1c0a99d22a4a41f57a3fa567c64684fc669c26b.jpg
        // 循环处理图片地址
        $slideImages = explode(',', $slideImages ?? '');
        foreach ($slideImages as $key => $value) {
            $slideImages[$key] = [
                'id' => $key,
                'image' => $value,
            ];
        }

        $this->success('获取成功', [
            'notice' => $notice,
            'slideImages' => $slideImages,
        ]);
    }
}